package cn.com.generaldata.os.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import cn.com.generaldata.os.constant.ReportConstant;
import cn.com.generaldata.os.dao.intf.BaseDAOInterface;
import cn.com.generaldata.os.pojo.Report;
import cn.com.generaldata.os.pojo.Unit;
import cn.com.generaldata.os.pojo.User;
import cn.com.generaldata.os.service.intf.ReportServiceInterface;

public class AutoCallWebServiceJob implements Job, ApplicationContextAware {
	private static ApplicationContext ctx;
	private BaseDAOInterface<Report> reportDAO;
	private BaseDAOInterface<User> userDAO;
	private BaseDAOInterface<Unit> unitDAO;

	// public void setReportDAO(BaseDAOInterface<Report> reportDAO) {
	// this.reportDAO = reportDAO;
	// }

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {

		ReportServiceInterface reportService = (ReportServiceInterface) ctx.getBean("reportService");
		reportService.createReportAccount(ReportConstant.PROVINCE_AREA_ID, null, null);

	}

	@Override
	public void setApplicationContext(ApplicationContext arg0) throws BeansException {
		AutoCallWebServiceJob.ctx = arg0;

	}
}
